<#assign title ="成长参数管理">
<#assign sexMap={"-1":"未知","0":"女","1":"男"} >
<#include "/include/layout.ftl">
<#macro css>
</#macro>
<#macro js>
</#macro>
<#macro body>
<#import "/include/page.ftl" as pages>
	<section class="content-header">
      <h1>
        ${title}
		<div class="pull-right">
			<a class="btn btn-info" href="${contextPath}/sys/grow/rule/create.html"><i class="fa fa-plus"></i> 添加</a>
			<a class="btn btn-danger" href="javascript:;" id="del" ><i class="fa fa-trash"></i> 删除</a>
		<div>
      </h1>
    </section>
	<section class="content">
	  <div class="row">
        <div class="col-xs-12">
          <div class="box">
            <div class="box-header">
              <h3 class="box-title"></h3>
              <div class="box-tools">
              </div>
            </div>
            <div class="box-body table-responsive no-padding">
              <form action="${contextPath}/sys/grow/rule/delete" method="post" id="documentForm" >
	              <table class="table table-bordered table-hover">
		                <tr>
		                  <th class="text-center"><input type="checkbox" class="checkAll" /></th>
		                  <th class="text-center">序号</th>
		                  <th class="text-center">成长参数名称</th>
		                  <th class="text-center">创建时间</th>
		                  <th class="text-center">状态</th>
		                  <th class="text-center">操作</th>
		                </tr>
	    			<#if page?? && page.list?? && page.list?size gt 0>
	        			<#list page.list as data>
	        				<tr>
	        				  <td class="text-center"><input type="checkbox" name="checkedid" value="${data.id}" /> </td>
	        				  <td class="text-center"><@pages.number page=page index=data_index /></td>
			                  <td class="text-center"><a href="${contextPath}/sys/grow/stage/index.html?ruleid=${data.id}">${data.rulename}</a></td>
			                  <td class="text-center">${long2date(data.createtime,"yyyy-MM-dd")}</td>
			                  <td class="text-center"><#if data.status==1>启用<#else><span style="color:red">停用</span></#if></td>
			                  <td class="text-center">
			                  	<a href="${contextPath}/sys/grow/rule/create.html?id=${data.id}"><i class="fa fa-edit"></i> 修改</a>
			                  </td>
	        				</tr>
	        			</#list>
	    			</#if>
	              </table>
              </form>
            </div>
            <div class="clearfix">
				<@pages.pageshow page=page url="${contextPath}/sys/grow/rule/index.html"  />
            </div>
          </div>
        </div>
      </div>
    </section>
    <script type="text/javascript">
		
		$(function(){
			//查找
			$(".search").click(function(){
				$("#searchForm").submit();
			})
		})
		
		//ajax 返回
		function showResponse(responseText, statusText) {
			var code = responseText.code;
			var msg = responseText.msg;
			if (code == "1") {
				  layer.alert(msg,{icon: 1}, function(index){
					  location.href="${contextPath}/sys/grow/rule/index.html";
				 	  layer.close(index);
				});  
			} else {
				layer.msg(msg, {icon: 2});
			}
		}	
		
		//表单验证
		function validateForm(){
		   return $("#documentForm").validate().form();
		}
	</script>
</#macro>